"use strict";

/**
 * @ngdoc filter
 * @name jgappApp.filter:avtarfilter
 * @function
 * @description
 * # avtarfilter
 * Filter in the jgappApp.
 */
angular
  .module("jgappApp")
  .filter("fileTypeAvtar", function() {
    var getIconName = function(type) {
      if (type) {
        switch (type) {
          case "folder":
            return "folder";
          case "pdf":
            return "pdf";
          case "txt":
            return "txt";
          case "png":
          case "jpg":
          case "gif":
          case "jpeg":
            return "picture";
          case "zip":
          case "rar":
          case "7z":
            return "zip";
          case "wps":
          case "doc":
          case "docx":
            return "word";
          case "et":
          case "xls":
          case "xlsx":
            return "excel";
          case "dps":
          case "ppt":
          case "pptx":
            return "ppt";
          case "mp4":
          case "avi":
          case "rmvb":
            return "video";
          case "cad":
            return "cad";
          default:
            return "unknow";
        }
      } else {
        return "unknow";
      }
    };
    return function(type) {
      return "icon_" + getIconName(type);
    };
  });
